package constant

// region TODO:卡片发行 状态枚举   Author:LiuYanLin  Date:2022/11/03 周四 14:20

type CardPublishStatus int64

func (c CardPublishStatus) ToString() string {
	switch c {
	case CardPublishStatus(CardPublishStatus10):
		return "添加库存"
	case CardPublishStatus(CardPublishStatus20):
		return "确认发行"
	case CardPublishStatus(CardPublishStatus30):
		return "取消发行"
	case CardPublishStatus(CardPublishStatus40):
		return "批次停用"
	default:
		return "未知"
	}
}

//endregion

//region TODO:卡片发行 下拉选择 Author:LiuYanLin Date:2023/04/17 周一 14:46

func (c CardPublishStatus) GetOption() []map[string]interface{} {
	return []map[string]interface{}{
		{"value": CardPublishStatus10, "title": CardPublishStatus(CardPublishStatus10).ToString()},
		{"value": CardPublishStatus20, "title": CardPublishStatus(CardPublishStatus20).ToString()},
		{"value": CardPublishStatus30, "title": CardPublishStatus(CardPublishStatus30).ToString()},
		{"value": CardPublishStatus40, "title": CardPublishStatus(CardPublishStatus40).ToString()},
	}
}

//endregion

// region TODO:卡片绑定 状态枚举   Author:LiuYanLin  Date:2022/11/03 周四 14:20

type CardBindingStatus int64

func (c CardBindingStatus) ToString() string {
	switch c {
	case CardBindingStatus(CardBindingStatus10):
		return "未绑定"
	case CardBindingStatus(CardBindingStatus20):
		return "已绑定"
	case CardBindingStatus(CardBindingStatus30):
		return "已解绑"
	default:
		return "未知"
	}
}

//endregion

//region TODO:卡片绑定 下拉选择 Author:LiuYanLin Date:2023/04/17 周一 14:46

func (c CardBindingStatus) GetOption() []map[string]interface{} {
	return []map[string]interface{}{
		{"value": CardBindingStatus10, "title": CardBindingStatus(CardBindingStatus10).ToString()},
		{"value": CardBindingStatus20, "title": CardBindingStatus(CardBindingStatus20).ToString()},
		{"value": CardBindingStatus30, "title": CardBindingStatus(CardBindingStatus30).ToString()},
	}
}

//endregion

// region TODO:卡片溯源信息 状态枚举   Author:LiuYanLin  Date:2022/11/03 周四 14:20

type CardTraceabilityStatus int64

func (c CardTraceabilityStatus) ToString() string {
	switch c {
	case CardTraceabilityStatus(CardTraceabilityStatus10):
		return "入库"
	case CardTraceabilityStatus(CardTraceabilityStatus20):
		return "发行"
	case CardTraceabilityStatus(CardTraceabilityStatus30):
		return "领用"
	case CardTraceabilityStatus(CardTraceabilityStatus40):
		return "绑定"
	case CardTraceabilityStatus(CardTraceabilityStatus50):
		return "使用"
	case CardTraceabilityStatus(CardTraceabilityStatus60):
		return "销毁"
	default:
		return "未知"
	}
}

//endregion

//region TODO:卡片溯源信息 下拉选择 Author:LiuYanLin Date:2023/04/17 周一 14:46

func (c CardTraceabilityStatus) GetOption() []map[string]interface{} {
	return []map[string]interface{}{
		{"value": CardTraceabilityStatus10, "title": CardTraceabilityStatus(CardTraceabilityStatus10).ToString()},
		{"value": CardTraceabilityStatus20, "title": CardTraceabilityStatus(CardTraceabilityStatus20).ToString()},
		{"value": CardTraceabilityStatus30, "title": CardTraceabilityStatus(CardTraceabilityStatus30).ToString()},
		{"value": CardTraceabilityStatus40, "title": CardTraceabilityStatus(CardTraceabilityStatus40).ToString()},
		{"value": CardTraceabilityStatus50, "title": CardTraceabilityStatus(CardTraceabilityStatus50).ToString()},
		{"value": CardTraceabilityStatus60, "title": CardTraceabilityStatus(CardTraceabilityStatus60).ToString()},
	}
}

//endregion

/*// 测试
func _test() {
	aaa := CardTraceabilityStatus(CardTraceabilityStatus60).ToString()
	tool.GLogLine(aaa)

	var getOption CardTraceabilityStatus
	tool.GLogLine(getOption.GetOption())
}*/
